|
i2crepeater 2.2.0
|
API for configuring and manipulating I2C Repeater Click driver. More...
Topics | |
| I2C Repeater Registers Settings | |
| Settings for registers of I2C Repeater Click driver. | |
| I2C Repeater MikroBUS Map | |
| MikroBUS pin mapping of I2C Repeater Click driver. | |
Functions | |
| void | i2crepeater_cfg_setup (i2crepeater_cfg_t *cfg) |
| I2C Repeater configuration object setup function. | |
| err_t | i2crepeater_init (i2crepeater_t *ctx, i2crepeater_cfg_t *cfg) |
| I2C Repeater initialization function. | |
| void | i2crepeater_enable_device (i2crepeater_t *ctx) |
| I2C Repeater enable device function. | |
| void | i2crepeater_disable_device (i2crepeater_t *ctx) |
| I2C Repeater disable device function. | |
| err_t | i2crepeater_set_i2c_address (i2crepeater_t *ctx, uint8_t slave_addr) |
| I2C Repeater set I2C address function. | |
| err_t | i2crepeater_i2c_write (i2crepeater_t *ctx, uint8_t *data_in, uint16_t len) |
| I2C Repeater write function. | |
| err_t | i2crepeater_i2c_read (i2crepeater_t *ctx, uint8_t *data_out, uint16_t len) |
| I2C Repeater read function. | |
| err_t | i2crepeater_i2c_write_then_read (i2crepeater_t *ctx, uint8_t *data_in, uint16_t in_len, uint8_t *data_out, uint8_t out_len) |
| I2C Repeater write then read function. | |
| err_t | i2crepeater_i2c_write_reg (i2crepeater_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
| I2C Repeater write register function. | |
| err_t | i2crepeater_i2c_read_reg (i2crepeater_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
| I2C Repeater read register function. | |
API for configuring and manipulating I2C Repeater Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void i2crepeater_cfg_setup | ( | i2crepeater_cfg_t * | cfg | ) |
I2C Repeater configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See i2crepeater_cfg_t object definition for detailed explanation. |
| void i2crepeater_disable_device | ( | i2crepeater_t * | ctx | ) |
I2C Repeater disable device function.
This function disables the device by setting the EN pin to low logic state.
| [in] | ctx | : Click context object. See i2crepeater_t object definition for detailed explanation. |
| void i2crepeater_enable_device | ( | i2crepeater_t * | ctx | ) |
I2C Repeater enable device function.
This function enables the device by setting the EN pin to high logic state.
| [in] | ctx | : Click context object. See i2crepeater_t object definition for detailed explanation. |
| err_t i2crepeater_i2c_read | ( | i2crepeater_t * | ctx, |
| uint8_t * | data_out, | ||
| uint16_t | len ) |
I2C Repeater read function.
This function reads data from the I2C slave.
| [in] | ctx | : Click context object. See i2crepeater_t object definition for detailed explanation. |
| [out] | data_out | : Data buffer to store read data. |
| [in] | len | : Number of bytes to read. |
0 - Success, -1 - Error. | err_t i2crepeater_i2c_read_reg | ( | i2crepeater_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out, | ||
| uint8_t | len ) |
I2C Repeater read register function.
This function reads data from a specific register of the I2C slave.
| [in] | ctx | : Click context object. See i2crepeater_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Data buffer to store read data. |
| [in] | len | : Number of bytes to read. |
0 - Success, -1 - Error. | err_t i2crepeater_i2c_write | ( | i2crepeater_t * | ctx, |
| uint8_t * | data_in, | ||
| uint16_t | len ) |
I2C Repeater write function.
This function writes data to the I2C slave.
| [in] | ctx | : Click context object. See i2crepeater_t object definition for detailed explanation. |
| [in] | data_in | : Data buffer to be written. |
| [in] | len | : Number of bytes to write. |
0 - Success, -1 - Error. | err_t i2crepeater_i2c_write_reg | ( | i2crepeater_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_in, | ||
| uint8_t | len ) |
I2C Repeater write register function.
This function writes data to a specific register of the I2C slave.
| [in] | ctx | : Click context object. See i2crepeater_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data buffer to be written. |
| [in] | len | : Number of bytes to write. |
0 - Success, -1 - Error. | err_t i2crepeater_i2c_write_then_read | ( | i2crepeater_t * | ctx, |
| uint8_t * | data_in, | ||
| uint16_t | in_len, | ||
| uint8_t * | data_out, | ||
| uint8_t | out_len ) |
I2C Repeater write then read function.
This function writes data to the I2C slave, then reads the response.
| [in] | ctx | : Click context object. See i2crepeater_t object definition for detailed explanation. |
| [in] | data_in | : Data buffer to be written. |
| [in] | in_len | : Number of bytes to write. |
| [out] | data_out | : Data buffer to store read data. |
| [in] | out_len | : Number of bytes to read. |
0 - Success, -1 - Error. | err_t i2crepeater_init | ( | i2crepeater_t * | ctx, |
| i2crepeater_cfg_t * | cfg ) |
I2C Repeater initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See i2crepeater_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See i2crepeater_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t i2crepeater_set_i2c_address | ( | i2crepeater_t * | ctx, |
| uint8_t | slave_addr ) |
I2C Repeater set I2C address function.
This function sets the slave address for I2C communication.
| [in] | ctx | : Click context object. See i2crepeater_t object definition for detailed explanation. |
| [in] | slave_addr | : I2C slave address. |
0 - Success, -1 - Error.